calendar: Use new snapshot transforms
authorBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 04:34:12 +0000 (05:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 21 Feb 2019 18:47:28 +0000 (19:47 +0100)
gtk/gtkcalendar.c

index 561a474f5b269a557e1320b4c9cb55f35c655ed7..6b941ced3e2827367085e5f135c7f459f697c0d2 100644 (file)
@@ -2010,9 +2010,9 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
   get_component_paddings (calendar, NULL, &day_name_padding, NULL);
   context = gtk_widget_get_style_context (widget);
 
-  gtk_snapshot_offset (snapshot,
-                       inner_border,
-                       priv->header_h + inner_border);
+  gtk_snapshot_save (snapshot);
+  gtk_snapshot_translate (snapshot,
+                          &GRAPHENE_POINT_INIT (inner_border, priv->header_h + inner_border));
 
   day_width = priv->day_width;
   cal_width = gtk_widget_get_width (widget) - (inner_border * 2);
@@ -2073,9 +2073,7 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
   g_object_unref (layout);
 
   gtk_style_context_restore (context);
-  gtk_snapshot_offset (snapshot,
-                       - inner_border,
-                       - (priv->header_h + inner_border));
+  gtk_snapshot_restore (snapshot);
 }
 
 static void
@@ -2403,16 +2401,15 @@ calendar_snapshot_arrow (GtkCalendar *calendar,
   else
     image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT;
 
-  gtk_snapshot_offset (snapshot,
-                       rect.x + (rect.width - 8) / 2,
-                       rect.y + (rect.height - 8) / 2);
+  gtk_snapshot_save (snapshot);
+  gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT(
+                          rect.x + (rect.width - 8) / 2,
+                          rect.y + (rect.height - 8) / 2));
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context),
                                snapshot,
                                8, 8,
                                image_type);
-  gtk_snapshot_offset (snapshot,
-                       - rect.x - (rect.width - 8) / 2,
-                       - rect.y - (rect.height - 8) / 2);
+  gtk_snapshot_restore (snapshot);
 
   gtk_style_context_restore (context);
 }